const http=require("http");
const routes=require("./module/routes")
http.createServer((req,res)=>{
    // 创建静态web服务
    routes.static(req,res,'static')
    // 路由
    let pathname=new URL(req.url,"http://localhost").pathname;
    console.log(pathname)
    if(pathname=='/login'){
        res.writeHead(200,{'Content-Type':"text/html;charset=UTF8"})
        res.end("登录方法")
    }else{
        res.writeHead(404,{'Content-Type':"text/html;charset=UTF8"})
        res.end("页面不存在")
    }
}).listen(3000)